From: Felix Fietkau Date: Thu, 7 Aug 2025 11:27:50 +0000 (+0200) Subject: hotplug: ensure that the button subsystem is always registered X-Git-Url: http://git.openwrt.org/%22https:/collectd.org//%22http:/www.crowdsec.net/%22/%22https:/collectd.org/%22http:/www.crowdsec.net/%22?a=commitdiff_plain;h=46780098002167070c665f03f1a8ed76d1e1c55f;p=project%2Fprocd.git hotplug: ensure that the button subsystem is always registered Its events are handled separately, so there usually is no hotplug.d directory for it. Signed-off-by: Felix Fietkau --- diff --git a/hotplug-dispatch.c b/hotplug-dispatch.c index 6e99942..fd87a09 100644 --- a/hotplug-dispatch.c +++ b/hotplug-dispatch.c @@ -375,6 +375,9 @@ static void remove_subsystem(char *name) { struct hotplug_subsys *h; + if (!strcmp(name, "button")) + return; + h = avl_find_element(&subsystems, name, h, node); if (!h) return; @@ -388,6 +391,8 @@ static int init_subsystems(void) DIR *dir; struct dirent *dirent; + add_subsystem("button"); + dir = opendir(HOTPLUG_BASEDIR); if (dir == NULL) return ENOENT;